import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;


public class DrawPanel extends JPanel
{
    CleverArray r2myArray;
    
    public DrawPanel (LayoutManager layout, boolean isDoubleBuffered, CleverArray myArray)
    {
        super(layout, isDoubleBuffered);
        r2myArray = myArray;
    }
    
    @Override                           
    protected void paintComponent( Graphics g )
    {
        for (int y=0; y<4; y++ ) {
            for (int x=0; x<2; x++) {
                int visible = r2myArray.getArrayElement(y,x);
                if (visible == 1) {
                    g.fillRect(x*10, y*10, 5, 5);
                } // end of if
                
            } // end of for
            
        } // end of for
    }
    
} 